/**
 *
 */
package com.naiterui.ehp.bs.im.network.protocl;

import com.naiterui.ehp.bp.utils.beans.BeanUtil;

/**
 * @author Gaoll
 * @since HZD-1.0.0
 */
@SuppressWarnings("rawtypes")
public class OfflineMessage extends Message implements Comparable<OfflineMessage> {

    /**
     * 字段或域定义：<code>serialVersionUID</code>
     */
    private static final long serialVersionUID = 835065790383474509L;

    /**
     * 构造函数
     * @throws Exception
     */
    public OfflineMessage(Message message) throws Exception {
        super();
        BeanUtil.copyProperties(message, this);
    }

    /**
     * @Author Gaoll
     * @Date 2016年8月11日
     * @since HZD-1.0.0
     * @param otherMessage
     * @return
     * @see java.lang.Comparable#compareTo(java.lang.Object)
     */
    @Override
    public int compareTo(OfflineMessage otherMessage) {

        if (null == otherMessage || null == otherMessage.getSendTime()) {
            return 0;
        }
        return this.getSendTime().compareTo(otherMessage.getSendTime());
    }

}
